/******************************************************************************
Copyright:
2009 Jens Collin (jens.collin@dinomin.com)

This file is part of Envox Decompiler.

Envox Decompiler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Envox Decompiler is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with KitchenOS.  If not, see <http://www.gnu.org/licenses/>.

******************************************************************************/
using System;

namespace EnvoxDecompiler
{
	/// <summary>
	/// Summary description for Block_Stop.
	/// </summary>
	public class Block_Stop : Block
	{

		
		public override TYPE GetBlockType()
		{
			return TYPE.Stop;
		}

		/// <summary>
		/// This block is smaller than normal, return smaller size.
		/// </summary>
		/// <returns></returns>
		public override int GetWidth()
		{
			return 64;
		}

		public override string GetXML(int x, int y)
		{
			Trace.Debug("Block_Stop::GetXML Started.");	
			// <ScriptEnd name="NAME" rect="X 32 96 56"
            string xml = "\t\t\t<ScriptEnd name=\"" + Utils.XmlString(_name) + "\" rect=\"" + x + " " + y + " 96 56\">\r\n";

			// <Inputs>
			xml += GetInputsXML(_blockId);
			
			// Stop block does not have any outputs.
			// <Outputs/>
			xml += "\t\t\t\t<Outputs/>\r\n";

			// </ScriptEnd>
			xml +="\t\t\t</ScriptEnd>\r\n";
			return xml;
		}


		public Block_Stop(byte[] rawData) : base(rawData)
		{
			outputErrorIds.Add(new BlockOutput(OUTPUT.Next, 0));

			Trace.Debug("Block_Stop created.");
		}
	}
}
